<style>
    body, html {
        background-color: white;
        height: 100%;
    }
    #tchData  tbody:first-child {
        border-top: #f9f9f9 0px solid;
    }
    .leftDiv{
        width: 48%;
        float: left;
    }
    .rightDiv{
        width: 48%;
        float: right;
    }
</style>
<script>
    var tabletShell = {{ tabletShell | json_encode }};
    var teachers    = {{ teachers | json_encode }};
    var iTchNum     = {{ iTchNum }};
</script>
<div id="title" style="text-align: center;font-size: 16px;line-height: 32px;color: grey;margin-top: 10px">领用人：{{ user }}</div>
<form id="ff" style="padding: 10px;" method="post">
    <input name="iRTId" type="hidden" value="{{ iRTId }}">
    <div style="margin-bottom:10px">
        <div class="leftDiv">
            <select  class="easyui-combobox" name="iProdId" label="学生机类型:" data-options="editable:false,labelPosition:'top'" style="width:100%">
                <option value="" style="display: none" selected>请选择</option>
                {% for id,text in prods  %}
                    <option value="{{ id }}">{{ text }}</option>
                {% endfor %}
            </select>
        </div>
        <div class="rightDiv">
            <select  class="easyui-combobox" name="iChargeMode" label="收费模式:" data-options="editable:false,labelPosition:'top'" style="width:100%">
                <option value="" style="display: none" selected>请选择</option>
                {% for id,text in mode  %}
                    <option value="{{ id }}">{{ text }}</option>
                {% endfor %}
            </select>
        </div>
    </div>
    <div style="margin-bottom:10px">
        <input id="iStuNum" class="easyui-numberbox" label="学生机数目:" name="iStuNum" value="{{ iStuNum }}" style="width:100%"
               data-options="editable:true,labelPosition:'top'"/>
    </div>
    <div style="text-align:center;padding:10px">
			<span class="m-buttongroup">
                <a href="javascript:void(0)" class="easyui-linkbutton" data-options="toggle:true,group:'g1',selected:true" onclick="show('#m-scanner')" style="width:80px;height:30px">扫码领用</a>
                <a href="javascript:void(0)" class="easyui-linkbutton" data-options="toggle:true,group:'g1'" onclick="show('#m-out')" style="width:80px;height:30px">直接出库</a>
			</span>
    </div>
    <div id="items" style="width: 100%">
        <div id="m-scanner" class="m-item">
            <div style="margin-bottom:10px">
                <div class="leftDiv">
                    <select  class="easyui-combobox" id="tchId"  label="教师:" data-options="editable:false,labelPosition:'top'" style="width:100%">
                        <option value="" style="display: none" selected>请选择</option>
                        {% for id,text in teachers  %}
                            <option value="{{ id }}">{{ text }}</option>
                        {% endfor %}
                    </select>
                </div>
                <div class="rightDiv">
                    <select  class="easyui-combobox" id="prodId"  label="教师机类型:" data-options="editable:false,labelPosition:'top'" style="width:100%">
                        <option value="" style="display: none" selected>请选择</option>
                        {% for id,text in prods  %}
                            <option value="{{ id }}">{{ text }}</option>
                        {% endfor %}
                    </select>
                </div>
            </div>
            <div style="margin-bottom:10px">
                <input  class="easyui-textbox teacher" label="教师设备码:" id="code"   style="width:100%"
                        data-options="editable:true,labelPosition:'top',buttonText:'扫描',buttonIcon:'btn-scan',prompt:'设备码'"/>
            </div>
            <table class="table table-hover">
                <tr class="info">
                    <th style="width: 20%;text-align: center">教师名称</th>
                    <th style="width: 30%;text-align: center">教师机型</th>
                    <th style="width: 35%;text-align: center">设备码</th>
                    <th style="width: 15%;text-align: center">操作</th>
                </tr>
                <tr>
                    <td colspan="4" style="padding: 0px;">
                        <div style="-webkit-overflow-scrolling:touch; overflow:auto; width:100%; height:186px; position:relative;">
                            <table id="tchData" class="table table-hover">
                                <tbody>

                                </tbody>
                            </table>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
        <div id="m-out" class="m-item" style="display: none">
            <div class="modelTchTr" style="margin-bottom:10px">
                <div class="leftDiv">
                    <select  class="easyui-combobox tchProd"   label="教师机类型:" data-options="editable:false,labelPosition:'top'" style="width:100%">
                        <option value="" style="display: none" selected>请选择</option>
                        {% for id,text in prods  %}
                            <option value="{{ id }}">{{ text }}</option>
                        {% endfor %}
                    </select>
                </div>
                <div class="rightDiv">
                    <input   class="easyui-numberbox tchProdNum" label="教师机数目:" value="{{ iTchNum }}"  style="width:100%"
                             data-options="editable:true,labelPosition:'top',min:0"/>
                </div>
            </div>

            <div style="margin-bottom:10px;">
                <a id="addTchProd" class="easyui-linkbutton" data-options="iconCls:'btn-save'" style="padding:5px 0px;width:140px;margin-top: 10px;">
                    <span style="font-size:14px;">新增教师机类型</span>
                </a>
            </div>
        </div>
    </div>


    <div class="modelTr" style="margin-bottom: 10px;height: 60px;">
            <div class="leftDiv">
                <select  class="easyui-combobox" name="shellCode[0][prodId]" label="选择平板种类:" data-options="editable:false,labelPosition:'top'" style="width:100%">
                    <option value="" style="display: none" selected>请选择</option>
                    {% for id,text in tabletShell  %}
                        <option value="{{ id }}">{{ text }}</option>
                    {% endfor %}
                </select>
            </div>
            <div class="rightDiv">
                <input id="iStuNum" class="easyui-numberbox" label="平板壳数目:" name="shellCode[0][iNum]" style="width:100%"
                       data-options="editable:true,labelPosition:'top'"/>
            </div>
    </div>

    <div style="margin-bottom:10px">
        <a id="addShell" class="easyui-linkbutton" data-options="iconCls:'btn-save'" style="padding:5px 0px;width:140px;float: left;margin-right: 5px;">
            <span style="font-size:14px;">新增平板类型</span>
        </a>
        <a id="save" class="easyui-linkbutton" data-options="iconCls:'btn-save'" style="padding:5px 0px;width:100px;float: right;margin-right: 5px;">
            <span style="font-size:14px;">提交</span>
        </a>
    </div>
</form>
<script>
    var currentItem = '#m-scanner';
    function show(id){
        $('div.m-item').hide();
        $(id).show();
        $.parser.parse(id);
        currentItem = id;
    }
</script>
